package vectorstore

import (
	"context"
	"github.com/cloudwego/eino/schema"
)

// Indexer 索引器接口，与ai-rag/indexer包中的接口兼容
type Indexer interface {
	AddDocuments(ctx context.Context, docs []*schema.Document) error
	UpdateDocuments(ctx context.Context, docs []*schema.Document) error
	DeleteDocuments(ctx context.Context, ids []string) error
	Search(ctx context.Context, queryVector []float64, topK int) ([]*schema.Document, error)
	GetDocuments(ctx context.Context, ids []string) ([]*schema.Document, error)
	Save(ctx context.Context) error
	Load(ctx context.Context) error
	Close() error
}

// FaissIndexerConfig Faiss索引器配置
type FaissIndexerConfig struct {
	IndexPath   string
	StoragePath string
	UseGPU      bool
	Dimension   int
	MetricType  string
}

// ChromaIndexerConfig Chroma索引器配置
type ChromaIndexerConfig struct {
	DBPath         string
	CollectionName string
	Dimension      int
	MetricType     string
}

// MilvusIndexerConfig Milvus索引器配置
type MilvusIndexerConfig struct {
	CollectionName string
	Address        string
	User           string
	Password       string
	Dimension      int
	MetricType     string
	Timeout        int
}

// PineconeIndexerConfig Pinecone索引器配置
type PineconeIndexerConfig struct {
	IndexName   string
	APIKey      string
	Environment string
	Dimension   int
	MetricType  string
}
